{% extends 'public/layout.html' %}
{% block css %}
    <style>
        .permission-content {
            width: 260px !important;
        }

        .permission-point {
            margin-left: 280px !important;
        }
    </style>
{% endblock %}
{% block body %}
    <dl class="dl-horizontal">

        <form action="" role="form" class="form-horizontal" method="post">
            {% for ct in content_type %}
                <dt class="permission-content">{{ ct.app_label }} ===>> {{ ct.model }}:</dt>
                <dd class="permission-point">
                    <ul class=" list-unstyled">
                        {% for p in ct.permission_set.all %}
                            <li>
                                <input type="checkbox" name="permission" value="{{ p.id }}"
                                       {% if p.id in group_permission %}checked{% endif %}>
                                <label>{{ p.name }}</label>
                            </li>
                        {% endfor %}
                    </ul>
                </dd>

            {% endfor %}
            {% if perms.auth.change_group and perms.auth.delete_group %}
                <div class="form-group form-footer">
                    <div class="col-sm-offset-3 col-sm-8">
                        {# 隐藏上传gid #}

                        <input type="hidden" name="group" value="{{ group }}">
                        <input type="submit" class="btn btn-primary" value="修改">
                        <input type="reset" class="btn btn-warning" value="重置">
                    </div>

                </div>
            {% endif %}
        </form>

    </dl>
{% endblock %}
